package com.example.test2023.Demo;

import com.example.test2023.Dao.UserDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class userDemo {
    public static void main(String[] args) {
        //获取配置文件路径
        ClassPathXmlApplicationContext app=
                new ClassPathXmlApplicationContext("applicationContext.xml");
        //通过接口获取配置文件中bean实例的id唯一标识获取bean
        UserDao userDao= (UserDao) app.getBean("userDao");
        //强制转换
        userDao.userDao();
    }
}
